//
//  MainDiscernDoneVC.m
//  ZITHER
//
//  Created by weixin on 2018/11/27.
//  Copyright © 2018 weixn. All rights reserved.
//

#import "MainDiscernDoneVC.h"
#import "MainCountDownView.h"


@interface MainDiscernDoneVC ()
@property (nonatomic,strong)BaseImageV * leftPic;
@property (nonatomic,strong)BaseLab * leftTitle;
@property (nonatomic,strong)BaseImageV * RightPic;
@property (nonatomic,strong)BaseLab * RightTitle;
@property (nonatomic,strong)MainCountDownView * CountDownView;
@end

@implementation MainDiscernDoneVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNav];
    [self setUI];
}

-(void)setNav{
    [self.baseNavigationView setHiddenNav:NO VC:self];
    [self.baseNavigationView NavigationBarStyle:1];
    self.baseNavigationView.navViewStyle.title.text = @"完善图库";
//    self.baseNavigationView.navViewStyle.leftBtn.hidden = YES;
    self.baseNavigationView.leftButton1.hidden = YES;
    
}

-(void)setUI{
    
    BaseImageV * pic = [[BaseImageV alloc]initializeFrame:CGRectMake(0, 0, 0, 0) contentMode:2];
    pic.image = [UIImage imageNamed:@"完善图库_提交成功"];
    pic.backgroundColor = [UIColor clearColor];
    [self.view addSubview:pic];

    BaseLab * title1 = [[BaseLab alloc]initializeFrame:CGRectMake(0, 0, 0, 0) text:@"恭喜，提交成功" font:12 textColor:[UIColor blackColor] isBold:NO numberOfLines:1];
    title1.font = [UIFont fontWithName:@"PingFangSC-Medium" size:16];

    [self.view addSubview:title1];
    
    [self.view addSubview:self.CountDownView];

    BaseLab * title2 = [[BaseLab alloc]initializeFrame:CGRectMake(0, 0, 0, 0) text:@"您提交的表款即将导入" font:12 textColor:[UIColor colorWithHex:@"999999"] isBold:NO numberOfLines:1];
    title2.font = [UIFont fontWithName:@"PingFangSC-Medium" size:12];
    [self.view addSubview:title2];
    
    BaseBtn * btn = [[BaseBtn alloc]initializeFrame:CGRectMake(0, 0, 1, 1) NormalText:@"确定" NormalTextColor:baseColorTheme SeleText:@"" SeleTextColor:baseColorTheme  font:15 isBold:NO];
    [btn setCornerRadiusWithRadius:4 isMasks:YES];
    [btn setBorderWithColor:baseColorTheme width:1];
    /** 按钮点击案例 */
    @weakify(self);
    [[btn rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
        @strongify(self);
        for (UIViewController *controller in self.navigationController.viewControllers) {
            if ([controller isKindOfClass:[UIViewController class]]) {
                UIViewController *A =(UIViewController *)controller;
                [self.navigationController popToViewController:A animated:YES];
            }
        }
    }];
    [self.view addSubview:btn];
    
    BaseLab * title3 = [[BaseLab alloc]initializeFrame:CGRectMake(0, 0, 0, 0) text:@"敬请期待" font:12 textColor:[UIColor colorWithHex:@"999999"] isBold:NO numberOfLines:1];
    title3.font = [UIFont fontWithName:@"PingFangSC-Medium" size:12];
    title3.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:title3];

    [pic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.mas_top).offset(NaviHeight+30);
        make.centerX.equalTo(self.view.mas_centerX).offset(0);
        make.height.width.mas_equalTo(60);
    }];
    
    [title1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(pic.mas_bottom).offset(30);
        make.centerX.equalTo(self.view.mas_centerX).offset(0);
    }];
    
    [title2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(title1.mas_bottom).offset(10);
        make.centerX.equalTo(self.view.mas_centerX).offset(0);
    }];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view.mas_bottom).offset(-100);
        make.left.equalTo(self.view).offset(15);
        make.right.equalTo(self.view).offset(-15);
        make.height.mas_equalTo(45);
    }];
    
    [self.CountDownView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(title2.mas_bottom).offset(30);
        make.left.equalTo(self.view).offset(0);
        make.right.equalTo(self.view).offset(0);
        make.height.mas_equalTo(50);
    }];
    
    [title3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.CountDownView.mas_bottom).offset(30);
        make.left.equalTo(self.view).offset(0);
        make.right.equalTo(self.view).offset(0);
    }];
    
    
    
}

-(MainCountDownView *)CountDownView{
    if (!_CountDownView) {
        _CountDownView = [[MainCountDownView alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
    }
    return _CountDownView;
}


-(void)dealloc{
//    [self.CountDownView.countDownForLabel destoryTimer];
//    [self.CountDownView.countDownForBtn destoryTimer];
    NSLog(@"%s dealloc",object_getClassName(self.CountDownView));
}


@end
